
<!-- src/App.vue -->
<template>
  <div id="app">
    <Navbar v-if="showNavbar" />
    <div class="main-content">
      <router-view />
    </div>
  </div>
</template>

<script setup>import { computed } from 'vue'
import { useRoute } from 'vue-router'
import Navbar from './components/Navbar.vue'

const route = useRoute()

// 根据路由元信息决定是否显示导航栏
const showNavbar = computed(() => {
  // 如果当前路由的 meta.hideNavbar 为 true，则不显示导航栏
  return !route.meta?.hideNavbar
})
</script>

<style>/* 全局重置样式，消除默认边距 */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  margin: 0;
  padding: 0;
  overflow-x: hidden;
}

#app {
  width: 100vw;
  height: 100vh;
  overflow: hidden;
}

.main-content {
  padding: 20px;
}

/* 确保导航栏紧贴边缘 */
.el-menu--horizontal {
  margin: 0 !important;
  padding: 0 !important;
  border-radius: 0 !important;
  width: 100vw !important;
}
</style>